package com.example.demo.service.impl;

import com.example.demo.dao.UserRoleDao;
import com.example.demo.domain.po.UserRole;
import com.example.demo.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @Description: 用户角色服务层实现
 * @Author: zsg
 * @Date: 2018/07/06 09:52
 */
@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleDao userRoleDao;

    @Override
    public List<UserRole> findUserRoleByUid(Long uid) {
        List<UserRole> userRoles = this.userRoleDao.queryByUid(uid);
        return userRoles;
    }

    @Override
    public List<UserRole> findUserRoleByRid(Long rid) {
        List<UserRole> userRoles = this.userRoleDao.queryByRid(rid);
        return userRoles;
    }

    @Override
    public void insert(UserRole userRole) {
        this.userRoleDao.insert(userRole);
    }
}
